<%@page import="java.util.Enumeration"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/include/page.jsp"%>
<!DOCTYPE html>
<html lang="en">
	<head>
		<title>http的测试页面 - 客户端单机系统</title>
		<%@ include file="/common/include/title.jsp" %>
	</head>
	<body>
		<%@ include file="/common/include/header.jsp" %>
		<!-- 网页的主体部分 -->
		<div class="container">
			<div class="row">
				<div class="col-md-11 col-sm-offset-1">
					<div class="table-responsive mt-2">
						<h3>请求头(<%=request.getMethod() %>)</h3>
						<table class="table table-striped table-hover">
							<thead>
								<tr>
									<th>名称</th>
									<th>链接</th>
								</tr>
							</thead>
							<tbody>
								<tr>
									<td>Cookie</td>
									<td>
										<%
											Cookie[] cookies = request.getCookies();
											if(cookies != null)
											{
												for(int i = 0 ; i < cookies.length ; i ++)
												{
													Cookie cookieTemp = cookies[i];
													out.println(cookieTemp.getName() + "-->" + cookieTemp.getValue() + ";" + cookieTemp.toString() + "<br/>");
												}
											}
										%>
									</td>
								</tr>
								<%
									Enumeration enu = request.getHeaderNames();
									while(enu.hasMoreElements())
									{
										String key = enu.nextElement() + "" ; 
										String value = request.getHeader(key);
								%>
									<tr>
										<td><%=key %></td>
										<td><%=value %></td>
									</tr>
								<%
									}
								%>
							</tbody>
						</table>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-md-11 col-sm-offset-1">
					<div class="table-responsive mt-2">
						<h3>请求体</h3>
						<table class="table table-striped table-hover">
							<thead>
								<tr>
									<th>日期</th>
									<th>明细</th>
								</tr>
							</thead>
							<tbody>
								<%
									enu = request.getParameterNames();
									while(enu.hasMoreElements())
									{
										String key = enu.nextElement() + "" ; 
										String value = request.getParameter(key);
								%>
									<tr>
										<td><%=key %></td>
										<td><%=value %></td>
									</tr>
								<%
									}
								%>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>
		<%@ include file="/common/include/footer.jsp" %>
	</body>
</html>